package com.controller;

import com.model.Surat;
import java.awt.BorderLayout;
import java.util.ArrayList;
import javax.swing.*;

public class PanelLihatDaftar extends JPanel{

    private JTable tableDaftar;
    private JLabel labelPanel;
    private ArrayList<Surat> data;

    public PanelLihatDaftar(ArrayList<Surat> data) {
        this.data = data;
        setLayout(new BorderLayout());
        labelPanel = new JLabel("Form Lihat Publikasi");
        labelPanel.setHorizontalAlignment(JLabel.CENTER);
        add(labelPanel, BorderLayout.NORTH);
        tableDaftar = new JTable();
        tableDaftar.setModel(new DaftarTableModel(data));
        add(tableDaftar, BorderLayout.CENTER);
    }

    public ArrayList<Surat> getData() {
        return data;
    }

    public void setData(ArrayList<Surat> data) {
        this.data = data;
    }
}
